# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-model-bakery
_pyname="model_bakery"
pkgver=1.20.0
pkgrel=0
arch="noarch"
pkgdesc="Smart object creation facility for Django"
url="https://pypi.python.org/project/model-bakary"
license="Apache-2.0"
depends="py3-django"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	py3-hatchling
	"
checkdepends="
	black
	py3-pytest-django
	py3-coverage
	py3-pillow
	py3-mypy
	ruff
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/model-bakers/model_bakery/archive/refs/tags/$pkgver.tar.gz
	remove-django-5.1-classifier.patch
	"
builddir="$srcdir"/$_pyname-$pkgver
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}
sha512sums="
35cf4e684ae336abf442611d88b5495adb56392e934627e3acf1bfb8c99b961331b61ed710152e1b64b2d170eb46020589f3b9e6a3bb2bd686e433caa86bbd5e  py3-model-bakery-1.20.0.tar.gz
8db93f8e935df7dbaa9f56410aa549279e673c5603d39d45dd00b6b96cf2f474c23eafebf391f24f59dc3ecbea4e7ad1215dd0f198d73ee509ad2c54ed69a730  remove-django-5.1-classifier.patch
"
